const Sequelize = require('sequelize')
const sequelize = require('../config/index')
const User = require('./user').User

let User_message_list = sequelize.define('user_message_list',{
    id:{
        type:Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true,
        comment:'id',
    },
    title:{
        type:Sequelize.TEXT('tiny')
    },
    content:{
        type:Sequelize.TEXT
    },
    type:{
        type:Sequelize.INTEGER,
        defaultValue:0,
        comment: '0' // 0 系统消息 1 任务消息 2留言消息 3 其他消息
    },
    to_user:{
        type: Sequelize.INTEGER
    }

},{

    freezeTableName: true,
})
User_message_list.belongsTo(User,{foreignKey: "uid"});
// Skill.belongsToMany(User, {through : 'userSkill'});


let user_message_list = User_message_list.sync();

module.exports = User_message_list

